/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 */

import React, {Component} from 'react';
import {
    ActionSheetIOS,
    CameraRoll,
    ListView,
    StyleSheet,
    Text,
    TouchableOpacity,
    View,
    Platform,
} from 'react-native';
import PhotoBrowser from '../../../../core/component/react-native-photo-browser/lib/index';
import Color from '../../../../core/constant/color';
// 照片结构
// const photos = [
//     {
//         caption: 'Single photo',
//         description: 'with caption, no grid button',
//         photo: 'https://resource.51taouk.com/Adminimages/home/Product/6/979a96f9-caca-4034-b55a-b25669b54f26.jpg?imageMogr2/format/jpg/thumbnail/400',
//     },
//     {
//         title: 'Single photo',
//         description: 'with caption, no grid button',
//         photo: 'https://resource.51taouk.com/Adminimages/home/Product/6/979a96f9-caca-4034-b55a-b25669b54f26.jpg?imageMogr2/format/jpg/thumbnail/400',
//     }
// ];

export default class PhotoBrowserExample extends Component {

    static navigationOptions = ({navigation, screenProps}) => ({
        title: "照片展示",
        headerTintColor: "white",
        headerStyle: {
            backgroundColor: Color.PRIMARY_COLOR,
            elevation: null
        },
        header:<View/>,
        tabBarVisible: false,
    });

    constructor(props) {
        super(props);
        this.state = {
        };
    }


    onPressBack=()=>{
        const {goBack} = this.props.navigation;
        goBack()
    }


    render() {
        const { photos,onRight } = this.props.navigation.state.params;

        return (
            <PhotoBrowser
                useCircleProgress={true}
                onBack={this.onPressBack}
                mediaList={photos}
                enableGrid={false}
                onRight={onRight}
            />
        );
    }

}

const styles = StyleSheet.create({
    container: {
        flex: 1,
    },
});